package com.xuan.service.impl;

import com.xuan.entity.Orders;
import com.xuan.mapper.OrdersMapper;
import com.xuan.service.IOrdersService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xuan
 * @since 2025-01-14
 */
@Service
public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, Orders> implements IOrdersService {
    @Override
    public boolean addOrder(Orders order) {
        return this.save(order);
    }

    @Override
    public boolean updateOrder(Long id, Orders order) {
        order.setId(id);  // 设置 ID
        return this.updateById(order);
    }

    @Override
    public boolean deleteOrder(Long id) {
        return this.removeById(id);
    }
}
